/*
 * Created on Tue Sep 26 2017
 * @flow
 * Copyright (c) 2017 jianglinjie
 */
'use strict';

import redis from 'redis';
import config from '../config';
import { logger } from '../utils/LoggerUtils';

const option = {
  host: config.redis.host,
  port: config.redis.port,
}
const client = redis.createClient(option);

client.on('error', (err) => {
  logger.error('redis error: ', err);
});

client.on('ready', () => {
  logger.info('redis ready ', option);
});

module.exports = client;
